package com.ruoyi.postscript.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.postscript.mapper.PostscriptMapper;
import com.ruoyi.postscript.domain.Postscript;
import com.ruoyi.postscript.service.IPostscriptService;

/**
 * 任务附言Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-09
 */
@Service
public class PostscriptServiceImpl implements IPostscriptService
{
    @Autowired
    private PostscriptMapper postscriptMapper;

    /**
     * 查询任务附言
     *
     * @param id 任务附言主键
     * @return 任务附言
     */
    @Override
    public Postscript selectPostscriptById(Long id)
    {
        return postscriptMapper.selectPostscriptById(id);
    }

    /**
     * 查询任务附言列表
     *
     * @param postscript 任务附言
     * @return 任务附言
     */
    @Override
    public List<Postscript> selectPostscriptList(Postscript postscript)
    {
        return postscriptMapper.selectPostscriptList(postscript);
    }

    /**
     * 新增任务附言
     *
     * @param postscript 任务附言
     * @return 结果
     */
    @Override
    public int insertPostscript(Postscript postscript)
    {
        postscript.setCreateTime(DateUtils.getNowDate());
        return postscriptMapper.insertPostscript(postscript);
    }

    /**
     * 修改任务附言
     *
     * @param postscript 任务附言
     * @return 结果
     */
    @Override
    public int updatePostscript(Postscript postscript)
    {
        postscript.setUpdateTime(DateUtils.getNowDate());
        return postscriptMapper.updatePostscript(postscript);
    }

    /**
     * 批量删除任务附言
     *
     * @param ids 需要删除的任务附言主键
     * @return 结果
     */
    @Override
    public int deletePostscriptByIds(Long[] ids)
    {
        return postscriptMapper.deletePostscriptByIds(ids);
    }


    /**
     * 批量逻辑删除任务附言
     *
     * @param ids 需要删除的任务附言主键
     * @return 结果
     */
    @Override
    public int logicDeletePostscript(Long[] ids,String delType,Long delUser)
    {
        return postscriptMapper.logicDeletePostscript(ids,delType,delUser);
    }

    /**
     * 删除任务附言信息
     *
     * @param id 任务附言主键
     * @return 结果
     */
    @Override
    public int deletePostscriptById(Long id)
    {
        return postscriptMapper.deletePostscriptById(id);
    }
}
